Skip to content

fix(minting): rename DATABASE_URL → MINTING_DATABASE_URL#525

Merged
blove merged 1 commit into
mainfrom
claude/minting-db-env-rename
May 22, 2026
Merged

fix(minting): rename DATABASE_URL → MINTING_DATABASE_URL#525
blove merged 1 commit into
mainfrom
claude/minting-db-env-rename

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 21, 2026

Summary

  • Avoids the Neon Vercel integration's runtime override of DATABASE_URL, which always points at the default neondb database
  • Minting service connects to a distinct minting database (separate schema for processed_events, licenses) — using a non-conflicting var name prevents shadowing

Why

End-to-end smoke kept failing with relation "processed_events" does not exist. Diagnostics confirmed Vercel was injecting DATABASE_URL=postgres://.../neondb at runtime even though the project-level env was set to postgres://.../minting. The Neon integration ships its own DATABASE_URL, DATABASE_URL_UNPOOLED, POSTGRES_URL, etc., and those win.

Run-book

After merge, set MINTING_DATABASE_URL on the threadplane-minting-service Vercel project (production + preview) to the pooled connection string for the minting database. The legacy DATABASE_URL can stay or be removed; it's no longer read.

Test plan

  • Unit: env.spec.ts updated and passing locally
  • Smoke: complete a fresh Checkout session post-deploy and confirm processed_events + licenses rows insert

🤖 Generated with Claude Code

…n integration override

The Neon Vercel integration injects DATABASE_URL (and DATABASE_URL_UNPOOLED,
POSTGRES_URL, etc.) pointing at the default `neondb` database — overriding
any project-level DATABASE_URL value we set. This caused the minting webhook
to connect to `neondb` (which doesn't have our schema) instead of the
`minting` database that owns processed_events + licenses.

Use a non-conflicting var name so the integration can't shadow it.

Run book:
  - Set MINTING_DATABASE_URL on the threadplane-minting-service Vercel
    project to the pooled connection string for the `minting` database.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview, Comment May 21, 2026 9:46pm

Request Review

@blove blove merged commit 463e79c into main May 22, 2026
22 checks passed
blove added a commit that referenced this pull request May 22, 2026
Reverts the verbose error body added in #520/#522. End-to-end smoke
passed; root cause was Neon integration shadowing DATABASE_URL — fixed
in #525.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant